<?php
    $this->assign('title','Grupo Despesa::Exibindo');
    $this->assign('page_local','Grupo Despesa');
    $this->assign('page_now','Exibindo Registro');
    $this->assign('panel_title','Exibindo Grupo Despesa');
    $this->start('content_form');
?>
<div class="panel-body">
    <div class="row mb20">
        <div class="col-sm-6">
            <div class="form-group">
                <label class="control-label">Tipo:</label>
                <div class="form-control-feedback"><?php echo $this->Func->NomeTipo($expenseGroup['ExpenseGroup']['tipo_expense']); ?></div>
            </div>
        </div>
        <div class="col-sm-6">
            <div class="form-group">
                <label class="control-label">Descrição:</label>
                <div class="control-group">
                    <div class="form-control-feedback"><?php echo h($expenseGroup['ExpenseGroup']['name']); ?></div>
                </div>
            </div>
        </div>
    </div>
    <div class="panel-footer">
        <?php echo $this->Html->link('<span class="glyphicon glyphicon-arrow-left"></span> Voltar',array('controller'=>$this->params['controller'],'action'=>'/'),array('class'=>'btn btn-default','escape'=>false)) ?>
        <?php echo $this->Html->link('<span class="glyphicon glyphicon-pencil"></span> Editar',array('controller'=>$this->params['controller'],'action'=>'edit',$expenseGroup['ExpenseGroup']['id']),array('class'=>'btn btn-primary','escape'=>false)) ?>
        <?php echo $this->Html->link('<span class="glyphicon glyphicon-file"></span> Novo',array('controller'=>$this->params['controller'],'action'=>'add'),array('class'=>'btn btn-success','escape'=>false)) ?>
        <?php echo $this->Form->postLink('<span class="glyphicon glyphicon-trash"></span> Excluir', array('action' => 'delete', $expenseGroup['ExpenseGroup']['id']), array('escape'=>false,"title"=>"","data-original-title"=>"Deletar Registro","data-placement"=>"top","data-toggle"=>"tooltip","class"=>"tooltips btn btn-link"), __('Deseja realmente excluir o registro # %s?', $expenseGroup['ExpenseGroup']['name'])); ?>
    </div>
    <?php
        $this->end();
        if (!empty($expenseGroup['Expense'])):
            $this->start('content_table');
            ?>
            <caption class="page-header">Lista Categorias</caption>
            <thead>
            <tr>
                <th class="col-sm-2"><?php echo __('Grupo Despesa'); ?></th>
                <th class="col-sm-8"><?php echo __('Name'); ?></th>
                <th class="col-sm-2 text-center">#</th>
            </tr>
            </thead>
            <tbody>
            <tr>
                <td class="vert-align" rowspan="<?php echo count($expenseGroup['Expense'])+1; ?>"><?php echo $expenseGroup['ExpenseGroup']['name']; ?></td>
            </tr>
            <?php foreach ($expenseGroup['Expense'] as $expense): ?>
                <tr>
                    <td><?php echo $expense['name']; ?></td>
                    <td class="text-center">
                        <?php echo $this->Func->btnOption($expense['id']) ?>
                    </td>
                </tr>
            <?php endforeach; ?>
            </tbody>
            <?php
            $this->end();
        endif;
    ?>